import request from "../index.js";
// 获取注册申请列表
export const getApplyListApi = (data) => {
	return request({
		url: `/user/apply_list`,
		data
	})
}
// 注册申请审核
export const applyReviewApi = (data) => {
	return request({
		url: `/user/apply_review`,
		method: 'post',
		data
	})
}
// 获取系统用户列表
export const getaccountVipListApi = (data, type = '') => {
	let url = ''
	if (type == '') {
		url = '/user/user_list'
	} else if (type == 'seller') {
		url = '/seller/lists'
	} else if (type == 'delivery') {
		url = '/delivery/lists'
	} else if (type == 'sale') {
		url = '/sale/sale_list'
	}
	return request({
		url: url,
		data
	})
}
// 获取/修改商家基础配置
export const getAndEditConfigApi = (delivery_cash_rate, type = '') => {
	let url = type ? '/delivery/config?action=save' : '/delivery/config'
	return request({
		url: url,
		method: 'post',
		data: {
			delivery_cash_rate
		}
	})
}
// 获取配送商详情
export const getUserDetailApi = (data, type = '') => {
	let url = type ? '/delivery/item_temp?action=save' : '/delivery/item_temp'
	return request({
		url: url,
		method: 'post',
		data
	})
}
// 获取配送服务费率
export const getconfigItemApi = (data, type = '') => {
	let url = type ? '/delivery/config_item?action=save' : '/delivery/config_item'
	return request({
		url: url,
		method: 'post',
		data
	})
}
// 获取配送周期列表
export const getPeriodicConfigApi = (id) => {
	return request({
		url: '/delivery/alone_cycles?id=' + id,
	})
}
// 设置周期开关
export const setSwitchApi = (data, action = '') => {
	let url = action ? `/delivery/alone_cycle_update?action=${action}` : '/delivery/alone_cycle_update'
	return request({
		url: url,
		method: 'post',
		data
	})
}
// 编辑周期
export const editCycleApi = (data) => {
	return request({
		url: '/delivery/alone_cycle_temp?action=save',
		method: 'post',
		data
	})
}
// 设置用户状态
export const setUserStatusApi = (data) => {
	return request({
		url: '/delivery/update',
		method: 'post',
		data
	})
}
// 获取配送的结算周期列表
export const getSettleCycleConfigListApi = (data) => {
	return request({
		url: '/delivery/cycle_list',
		data
	})
}
// 设置结算周期指定的参数值
export const cycleUpdateApi = (data) => {
	return request({
		url: '/delivery/cycle_update',
		method: 'post',
		data
	})
}
// 单个周期新增/编辑
export const submitcycleTempApi = (data, action = '') => {
	let url = action ? `/delivery/cycle_temp?action=save` : '/delivery/cycle_temp'
	return request({
		url: url,
		method: 'post',
		data
	})
}
// 获取商品分类列表
export const getGoodsCategoryListApi = (data) => {
	return request({
		url: '/delivery/cate_list',
		data
	})
}
// 设置商品分类启用开关
export const cateUpdateApi = (data) => {
	return request({
		url: '/delivery/cate_update',
		method: 'post',
		data
	})
}
// 新增/编辑商品分类
export const submitCateTempApi = (data, action = '') => {
	let url = action ? `/delivery/cate_temp?action=save` : '/delivery/cate_temp'
	return request({
		url: url,
		method: 'post',
		data
	})
}
// 获取配送商商品列表
export const getGoodListApi = (data) => {
	return request({
		url: '/delivery/goods_list',
		data
	})
}
// 商品上下架
export const goodsUpdateApi = (data) => {
	return request({
		url: '/delivery/goods_update',
		method: 'post',
		data
	})
}
// 获取商品详情
export const getGoodsInfoApi = (data, action = '') => {
	let url = action ? `/delivery/goods_temp?action=save` : '/delivery/goods_temp'
	return request({
		url: url,
		method: 'post',
		data
	})
}